package com.xiyuan.smartutils.template.engine.statement;

import com.xiyuan.smartutils.template.engine.StatementParser;
import com.xiyuan.smartutils.template.engine.TagType;
import com.xiyuan.smartutils.template.engine.VariableMap;
import com.xiyuan.smartutils.template.engine.expression.Expression;

import java.io.PrintWriter;

/**
 * 调用语句不显示返回值，格式为：@{obj.setName("abc")}
 * 
 * @see _Echo 调用并显示返回值
 * @see _Echo_Format 调用显示格式化的返回值
 * @author lgz 2020年10月29日 新建与整理
 */
public class _Call extends _Echo
{
    private static final long serialVersionUID = 1L;
    
    public _Call(StatementParser parser)
    {
        super(parser);
    }
    
    protected void build(VariableMap variableMap, PrintWriter out)
    {
        for (Expression expression : this.expressions)
            expression.execute(variableMap);
    }
    
    public boolean isMultiExpression()
    {// 支持多调用
        return true;
    }
    
    @Override
    public TagType getType()
    {
        return TagType.CALL;
    }
}
